package com.example.myapplication.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.myapplication.entity.BorrowAndLoan;
import com.example.myapplication.entity.Budget;
import com.example.myapplication.entity.Finance;
import com.example.myapplication.entity.Income;
import com.example.myapplication.entity.Pay;

import com.example.myapplication.greendao.BorrowAndLoanDao;
import com.example.myapplication.greendao.BudgetDao;
import com.example.myapplication.greendao.FinanceDao;
import com.example.myapplication.greendao.IncomeDao;
import com.example.myapplication.greendao.PayDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig borrowAndLoanDaoConfig;
    private final DaoConfig budgetDaoConfig;
    private final DaoConfig financeDaoConfig;
    private final DaoConfig incomeDaoConfig;
    private final DaoConfig payDaoConfig;

    private final BorrowAndLoanDao borrowAndLoanDao;
    private final BudgetDao budgetDao;
    private final FinanceDao financeDao;
    private final IncomeDao incomeDao;
    private final PayDao payDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        borrowAndLoanDaoConfig = daoConfigMap.get(BorrowAndLoanDao.class).clone();
        borrowAndLoanDaoConfig.initIdentityScope(type);

        budgetDaoConfig = daoConfigMap.get(BudgetDao.class).clone();
        budgetDaoConfig.initIdentityScope(type);

        financeDaoConfig = daoConfigMap.get(FinanceDao.class).clone();
        financeDaoConfig.initIdentityScope(type);

        incomeDaoConfig = daoConfigMap.get(IncomeDao.class).clone();
        incomeDaoConfig.initIdentityScope(type);

        payDaoConfig = daoConfigMap.get(PayDao.class).clone();
        payDaoConfig.initIdentityScope(type);

        borrowAndLoanDao = new BorrowAndLoanDao(borrowAndLoanDaoConfig, this);
        budgetDao = new BudgetDao(budgetDaoConfig, this);
        financeDao = new FinanceDao(financeDaoConfig, this);
        incomeDao = new IncomeDao(incomeDaoConfig, this);
        payDao = new PayDao(payDaoConfig, this);

        registerDao(BorrowAndLoan.class, borrowAndLoanDao);
        registerDao(Budget.class, budgetDao);
        registerDao(Finance.class, financeDao);
        registerDao(Income.class, incomeDao);
        registerDao(Pay.class, payDao);
    }
    
    public void clear() {
        borrowAndLoanDaoConfig.clearIdentityScope();
        budgetDaoConfig.clearIdentityScope();
        financeDaoConfig.clearIdentityScope();
        incomeDaoConfig.clearIdentityScope();
        payDaoConfig.clearIdentityScope();
    }

    public BorrowAndLoanDao getBorrowAndLoanDao() {
        return borrowAndLoanDao;
    }

    public BudgetDao getBudgetDao() {
        return budgetDao;
    }

    public FinanceDao getFinanceDao() {
        return financeDao;
    }

    public IncomeDao getIncomeDao() {
        return incomeDao;
    }

    public PayDao getPayDao() {
        return payDao;
    }

}
